import request from "@/utils/request";

// 获取设备状态下拉列表
export function getEquipmentStatusList() {
	return request({
		url: "/operation/web/operationDeviceCatalog/equipmentStatusList",
		method: "get",
	});
}

// 获取设备类型下拉列表
export function getEquipmentTypeList() {
	return request({
		url: "/operation/web/operationDeviceCatalog/equipmentTypeList",
		method: "get",
	});
}

// 查询设备名录列表
export function getDeviceCatalogList(params) {
	return request({
		url: "/operation/web/operationDeviceCatalog/list",
		method: "get",
		params,
	});
}

// 获取设备名录详细信息
export function getDeviceCatalogDetail(id) {
	return request({
		url: `/operation/web/operationDeviceCatalog/${id}`,
		method: "get",
	});
}

// 新增设备名录
export function addDeviceCatalog(data) {
	return request({
		url: "/operation/web/operationDeviceCatalog",
		method: "post",
		data,
	});
}

// 修改设备名录
export function updateDeviceCatalog(data) {
	return request({
		url: "/operation/web/operationDeviceCatalog",
		method: "put",
		data,
	});
}

// 删除设备名录
export function deleteDeviceCatalog(ids) {
	return request({
		url: `/operation/web/operationDeviceCatalog/${ids}`,
		method: "delete",
	});
}

// 导出设备名录列表
export function exportDeviceCatalog(params) {
	return request({
		url: "/operation/web/operationDeviceCatalog/export",
		method: "get",
		params,
		responseType: "blob",
	});
}

// 获取设备状态占比统计
export function getStatusRatio() {
	return request({
		url: "/operation/web/operationDeviceCatalog/getStatusRatio",
		method: "get",
	});
}

// 统计各设备类型的数量
export function getCountByEquipmentType() {
	return request({
		url: "/operation/web/operationDeviceCatalog/getCountByEquipmentType",
		method: "get",
	});
}
